<html>
<head><meta charset="utf-8"><title>issues #32077 · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html">issues #32077</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221430012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221430012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221430012">(Jan 03 2021 at 02:50)</a>:</h4>
<p>Hello, I've recently run into <a href="https://github.com/rust-lang/rust/issues/32077">#32077</a>, and I wanted to see what I could do to help fix it. Looking at the issue, I see it's blocked on <a href="https://github.com/rust-lang/rust/issues/14072">#14072</a>, but I'm not really sure where to get started on this.</p>



<a name="221431200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431200">(Jan 03 2021 at 03:30)</a>:</h4>
<p><span class="user-mention" data-user-id="303115">@Quy Nguyen</span> I am unclear what's going on in that issue. I modified the example in the OP:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">Event</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="sd">/// a key was pressed/released</span>
<span class="k">pub</span><span class="w"> </span><span class="k">type</span> <span class="nc">KeyPressEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Event</span><span class="o">&lt;</span><span class="kt">usize</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="k">impl</span><span class="w"> </span><span class="n">KeyPressEvent</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="sd">/// The keycode (a number representing a physical key on the keyboard) of the key</span>
<span class="w">    </span><span class="sd">/// which was pressed.</span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">detail</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="w">    </span><span class="sd">/// Time when the event was generated (in milliseconds).</span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">time</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>which rendered this documentation:<br>
<a href="/user_uploads/4715/iN1ZbH7KEtjhgRMY-CgOkWXY/image.png">image.png</a> <br>
which looks right to me. What is the bug you're running into?</p>
<div class="message_inline_image"><a href="/user_uploads/4715/iN1ZbH7KEtjhgRMY-CgOkWXY/image.png" title="image.png"><img src="/user_uploads/4715/iN1ZbH7KEtjhgRMY-CgOkWXY/image.png"></a></div>



<a name="221431224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431224">(Jan 03 2021 at 03:31)</a>:</h4>
<p>someone mentioned a further bug that rustdoc doesn't follow type aliases, but I see <a href="https://github.com/rust-lang/rust/pull/42027">https://github.com/rust-lang/rust/pull/42027</a> which was merged and claimed to fix it</p>



<a name="221431226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431226">(Jan 03 2021 at 03:31)</a>:</h4>
<p>so I am unclear what the actual bug is</p>



<a name="221431286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431286">(Jan 03 2021 at 03:33)</a>:</h4>
<p>ok, so one difference is that <code>Event</code> is public in my code but not the OP - is that what you mean?</p>



<a name="221431293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431293">(Jan 03 2021 at 03:33)</a>:</h4>
<p>what can you actually do with a public alias to a private type?</p>



<a name="221431862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431862">(Jan 03 2021 at 03:51)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/42027">#42027</a> fixed that simple case, but not this</p>
<div class="codehilite"><pre><span></span><code>pub struct Event&lt;T&gt;;
/// a key was pressed/released
pub type KeyPressEvent = Event&lt;usize&gt;;

impl&lt;T&gt; Event&lt;T&gt; {
    /// The keycode (a number representing a physical key on the keyboard) of the key
    /// which was pressed.
    pub fn detail(&amp;self) {}

    /// Time when the event was generated (in milliseconds).
    pub fn time(&amp;self) {}
}
</code></pre></div>



<a name="221431917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431917">(Jan 03 2021 at 03:53)</a>:</h4>
<p>ok, the issue is that the documentation appears on <code>Event</code> but not <code>KeyPressEvent</code>, because the impl block used the name <code>Event&lt;T&gt;</code></p>



<a name="221431921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431921">(Jan 03 2021 at 03:53)</a>:</h4>
<p>unfortunately that probably means you won't be able to reuse much of the code from the simple fix</p>



<a name="221431928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221431928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221431928">(Jan 03 2021 at 03:54)</a>:</h4>
<p>I would see how <code>Deref</code> docs are rendered, that does something similar where it looks at accessible associated items instead of just on the current item</p>



<a name="221432097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221432097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221432097">(Jan 03 2021 at 03:59)</a>:</h4>
<p>I can't speak to whether a fix for this would be accepted without first fixing <a href="https://github.com/rust-lang/rust/issues/14072">https://github.com/rust-lang/rust/issues/14072</a></p>



<a name="221432568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221432568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221432568">(Jan 03 2021 at 04:13)</a>:</h4>
<p>Hmm funnily enough this works</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">FooA</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">type</span> <span class="nc">FooB</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">FooA</span><span class="o">&lt;</span><span class="kt">usize</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FooA</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">happy</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="w"> </span><span class="n">FooB</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">happyer</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>


<span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">Bar</span><span class="p">;</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">std</span>::<span class="n">ops</span>::<span class="n">Deref</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Target</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">FooB</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">deref</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nc">FooB</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="fm">unimplemented!</span><span class="p">()</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="221432569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221432569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221432569">(Jan 03 2021 at 04:13)</a>:</h4>
<p>But the regular docs don't render</p>



<a name="221432618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221432618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221432618">(Jan 03 2021 at 04:14)</a>:</h4>
<p>(btw you can mark the code block as <code> ```rust</code> and it will highlight as rust)</p>



<a name="221432683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221432683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221432683">(Jan 03 2021 at 04:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="303115">Quy Nguyen</span> <a href="#narrow/stream/266220-rustdoc/topic/issues.20.2332077/near/221432568">said</a>:</p>
<blockquote>
<p>Hmm funnily enough this works</p>
</blockquote>
<p>honestly that doesn't suprise me too much - rustdoc has two ways that it collects data, one through the HIR ('what syntax you used') and one through metadata ('what is available to downstream crates'). Deref uses metadata, which normalizes a lot of things to be consistent.</p>



<a name="221432702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221432702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221432702">(Jan 03 2021 at 04:17)</a>:</h4>
<p>so that's one possible way to fix this, use metadata for rendering info on type aliases</p>



<a name="221436219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221436219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221436219">(Jan 03 2021 at 06:06)</a>:</h4>
<p>Did the changes so you don't have to build the compiler go through? Also, what's the difference (code-wise) between the two? Everything is stuffed into the <code>clean::types</code> module according to the docs.</p>



<a name="221450667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221450667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221450667">(Jan 03 2021 at 13:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="303115">Quy Nguyen</span> <a href="#narrow/stream/266220-rustdoc/topic/issues.20.2332077/near/221436219">said</a>:</p>
<blockquote>
<p>Did the changes so you don't have to build the compiler go through? Also, what's the difference (code-wise) between the two? Everything is stuffed into the <code>clean::types</code> module according to the docs.</p>
</blockquote>
<p>It's still in progress. We are also working on reducing the size of the <code>clean::types</code> module (by relying more and more upon the <code>rustc</code> internals API. For the moment, we achieved great improvements in both speed and memory usage. About the difference betweeen HIR and <code>clean</code>, the second is a "wrapper" over the first to put things simply. It makes manipulating HIR items simpler from rustdoc point of view.</p>



<a name="221455435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221455435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221455435">(Jan 03 2021 at 15:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="303115">Quy Nguyen</span> <a href="#narrow/stream/266220-rustdoc/topic/issues.20.2332077/near/221436219">said</a>:</p>
<blockquote>
<p>Did the changes so you don't have to build the compiler go through?</p>
</blockquote>
<p>you can track that at <a href="https://github.com/rust-lang/rust/pull/79540">https://github.com/rust-lang/rust/pull/79540</a></p>



<a name="221468187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221468187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221468187">(Jan 03 2021 at 20:02)</a>:</h4>
<p>How do I turn a <code>DefId</code> into the metadata definition?</p>



<a name="221468221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221468221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221468221">(Jan 03 2021 at 20:03)</a>:</h4>
<p>what do you mean by 'metadata definition'?</p>



<a name="221468269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221468269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221468269">(Jan 03 2021 at 20:04)</a>:</h4>
<p>DefId is the metadata, in some sense</p>



<a name="221468290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221468290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221468290">(Jan 03 2021 at 20:04)</a>:</h4>
<p>There's a trait represented as a <code>ResolvedPath</code>, and I need the original definition of the trait to replace the generics.</p>



<a name="221468311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221468311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221468311">(Jan 03 2021 at 20:05)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.trait_def">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.trait_def</a></p>



<a name="221468316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221468316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221468316">(Jan 03 2021 at 20:05)</a>:</h4>
<p>(most things are on TyCtxt)</p>



<a name="221469376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221469376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221469376">(Jan 03 2021 at 20:27)</a>:</h4>
<p>Does the <code>TyCtxt</code> in <code>SharedCtxt</code> work? It's not used anywhere in Rustdoc.</p>



<a name="221469469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221469469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221469469">(Jan 03 2021 at 20:29)</a>:</h4>
<p>SharedCtxt is probably too late - this is in <code>render</code>, right? right now all the computation happens in <code>clean</code></p>



<a name="221469515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221469515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221469515">(Jan 03 2021 at 20:30)</a>:</h4>
<p>and render should just be for actually generating the HTML, not looking up what the types are</p>



<a name="221486069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486069">(Jan 04 2021 at 03:28)</a>:</h4>
<p>How do I get a runnable rustdoc off your fork? Just <code>x.py build</code> and pay the tax?</p>



<a name="221486094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486094">(Jan 04 2021 at 03:29)</a>:</h4>
<p>you mean from the <code>no-xpy</code> branch? <code>git fetch origin pull/79540/head &amp;&amp; git rebase -i FETCH_HEAD</code>, then set <code>[rust] download-stage1 = true</code> in config.toml</p>



<a name="221486101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486101">(Jan 04 2021 at 03:29)</a>:</h4>
<p>and then x.py should work like normal</p>



<a name="221486173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486173">(Jan 04 2021 at 03:30)</a>:</h4>
<p>(no-xpy is now a misnomer but github doesn't allow renaming branches without closing the PR)</p>



<a name="221486294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486294">(Jan 04 2021 at 03:33)</a>:</h4>
<p>oh when you rebase make sure to drop all commits except your own, git gets confused and tries to apply all commits to master since I rebased the PR last</p>



<a name="221486432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486432">(Jan 04 2021 at 03:36)</a>:</h4>
<p>downloading <code>https://ci-artifacts.rust-lang.org/rustc-builds/a44774c3a9739b2eea8923e09d67b14312c78ef3/rust-std-nightly-x86_64-pc-windows-msvc.tar.xz</code> failed with 404 - did I screw up my git or is that build not published?</p>



<a name="221486447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486447">(Jan 04 2021 at 03:37)</a>:</h4>
<p>hmm, that's weird</p>



<a name="221486452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486452">(Jan 04 2021 at 03:37)</a>:</h4>
<p>oh wow that is a <em>long</em> way back</p>



<a name="221486456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486456">(Jan 04 2021 at 03:37)</a>:</h4>
<p>you need to rebase to a commit that's less than 6 months out or the artifacts will have been deleted</p>



<a name="221486514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486514">(Jan 04 2021 at 03:38)</a>:</h4>
<p>so I would guess you probably did something strange with git, yeah</p>



<a name="221486547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221486547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221486547">(Jan 04 2021 at 03:39)</a>:</h4>
<p>merge-base with my PR and master is <a href="https://github.com/rust-lang/rust/commit/bb178237c5539c75e1b85ab78a8ab902b1f333d5">bb178237c5539c75e1b85ab78a8ab902b1f333d5</a> (1 week ago) so it's not left over from my experimenting with old commits</p>



<a name="221490313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221490313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221490313">(Jan 04 2021 at 05:18)</a>:</h4>
<p>Nice, got it working. What's the mystery boolean in TypeDefItem?</p>



<a name="221490314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221490314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221490314">(Jan 04 2021 at 05:18)</a>:</h4>
<p>whether it's an associated item, apparently</p>



<a name="221490318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221490318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221490318">(Jan 04 2021 at 05:18)</a>:</h4>
<p>that bit is still mostly a mystery to me</p>



<a name="221490327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221490327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221490327">(Jan 04 2021 at 05:19)</a>:</h4>
<p>but I did make some minor cleanups: <a href="https://github.com/rust-lang/rust/pull/80661">https://github.com/rust-lang/rust/pull/80661</a></p>



<a name="221491354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221491354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221491354">(Jan 04 2021 at 05:47)</a>:</h4>
<p>Does Rustdoc expand type aliases? I know HIR wise it doesn't, but whenever it inlines from another crate does it expand it then?</p>



<a name="221491811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221491811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221491811">(Jan 04 2021 at 05:58)</a>:</h4>
<p>Right, so that's what I found: ty::Ty automatically expands aliases but hir::Ty does not</p>



<a name="221491825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221491825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221491825">(Jan 04 2021 at 05:59)</a>:</h4>
<p>So the fix in all those places was to use tcx.type_of or hir_ty_to_ty</p>



<a name="221495825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221495825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221495825">(Jan 04 2021 at 07:31)</a>:</h4>
<p>So really I just need to substitute every generic with the actual parameter. I could modify the cleaned structs in place, but that might mess with what the json backend or other parts of Rustdoc assume. The other way is to store the (raw, unsubstituted) generics and sub them in during render time, but that'll likely bloat memory use.</p>



<a name="221524568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221524568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221524568">(Jan 04 2021 at 13:48)</a>:</h4>
<p>I would start by modifying in place and see what breaks</p>



<a name="221524635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221524635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221524635">(Jan 04 2021 at 13:49)</a>:</h4>
<p>I would <em>hope</em> rustdoc isn't depending on the names for anything</p>



<a name="221714494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221714494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221714494">(Jan 05 2021 at 23:12)</a>:</h4>
<p>Hmm so I can't modify in place because not all of the items are available to me then, for instance if I impl a trait and don't override any defaults, all the  <code>MethodItem</code>s are stored on the trait and not actually on the <code>ImplItem</code>.</p>



<a name="221714742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221714742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221714742">(Jan 05 2021 at 23:15)</a>:</h4>
<p>Althoguh the implemntation also splices stuff in from Deref impls, so I'd also need to keep where I get the methods for those too. Probably going to do traits first as most everything is self contained tho.</p>



<a name="221729445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/221729445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#221729445">(Jan 06 2021 at 03:14)</a>:</h4>
<p><span class="user-mention" data-user-id="303115">@Quy Nguyen</span> can you do this at the same time these items are generated? Then you don't have to modify them after the fact</p>



<a name="222123802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/issues%20%2332077/near/222123802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/issues.20.2332077.html#222123802">(Jan 08 2021 at 20:48)</a>:</h4>
<p>Default method implemntations for traits aren't contained in an impl, so there's no way for me to change them without cloning everything. I'm just gonna try substitution at render time for now.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>